function login(username:string):string{
    return 'ok'
}
function login1<T>(username:T):T{
    return username
}
let res = login1("xiaoming")
console.log(res)

function yyy<A,B>(a:A,b:B):[A,B]{
    return[a,b]
}
console.log(yyy('name','xiaoming'))

function xxx<T extends string>(a:T):T{
    return a
}
let res2 = xxx("xiaoming")
type mmm = "small"|"big"
function ppp<T extends mmm>(a:T){
    return a
}
let res3 = ppp("big")

type lll = {name:string,age:number}
let p1:lll = {
    name:"zs",
    age:23
}

type fff = keyof lll
function ppp1<T extends fff>(a:T){
    return a
}
let res4 = ppp1("age")
function getValue(obj,xxx){
    return obj[xxx]
}
let res5 = getValue({name:'zs',age:23},'age')
console.log(res5)

function getValue1<T,K extends keyof T>(obj:T,xxx:K){
    return obj[xxx]
}
console.log(getValue1("xiaoming","length"))